import Taro , { Component } from '@tarojs/taro'
import { View , Image , Text} from '@tarojs/components'


import './addressItem.scss'

export default class addressItem extends Component{

  static options = {
    addGlobalClass: true
  }

  defaultProps = {
    addressData : {}
  }

  onAddressItemClick = () =>{

  }

  render(){

    let addressData = this.props.addressData;
    let address = addressData.provinceName + addressData.cityName + addressData.areaName + addressData.address;
    return(
      <View className='address-item-container' onClick={this.onAddressItemClick.bind(this)}>
        <View className='address-item-sub'>
          <View className='address-item-name-con'>
            <Text className='address-item-name'>{addressData.userName}</Text>
            <Text className='address-item-phone'>{addressData.mobile}</Text>
            {addressData.isShow && <View className='address-item-default-container'>
              <Text className='address-item-default'>默认</Text>
            </View>
            }
          </View>
          <Text className='address-item-address'>{address}</Text>
        </View>
        <View className='address-item-divider'></View>
      </View>
    )
  }


}

